package com.example.sys.address.dao;

import com.example.core.dao.BaseTreeDao;
import com.example.sys.address.po.SysAddress;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

@Mapper
public interface SysAddressDao extends BaseTreeDao<SysAddress> {

    @Select("select * from sys_address where parent_id is null ORDER BY order_num asc ")
    @Override
    List<SysAddress> findRoot();

    @Select("select * from sys_address where parent_id =#{pid} ORDER BY order_num asc ")
    @Override
    List<SysAddress> findByPId(@Param("pid") Serializable pid);
}
